<template>
    <div class="container">
        <div class="header">
            <p>表单管理 >> 表单详情</p>
            <el-button class="link" type="info" @click="$router.back()">
                返回
            </el-button>
        </div>
        <div class="main">
            <div class="sub_title">基础信息</div>
            <el-form
                    ref="information"
                    label-width="150px"
                    class=""
            >
                <div class="flex-box-align">
                    <el-form-item
                            label="姓名："
                            prop="name"
                    >
                        {{params.name}}
                    </el-form-item>
                    <el-form-item
                            label="性别："
                            prop="sex"
                    >
                        {{params.sex}}
                    </el-form-item>
                    <el-form-item
                            label="民族："
                            prop="title"
                    >
                        {{params.nation}}
                    </el-form-item>
                    <el-form-item
                            label="身高"
                            prop="height"
                    >
                        {{params.height}}
                    </el-form-item>
                    <el-form-item
                            label="体重："
                            prop="weight"
                    >
                        {{params.weight}}
                    </el-form-item>
                </div>

                <div class="flex-box-align">
                    <el-form-item
                            label="学历："
                            prop="diplomas"
                    >
                        {{params.diplomas}}
                    </el-form-item>
                    <el-form-item
                            label="出生年月："
                            prop="birthDate"
                    >
                        {{params.birthDate}}
                    </el-form-item>
                    <el-form-item
                            label="联系方式："
                            prop="phone"
                    >
                        {{params.phone}}
                    </el-form-item>
                </div>
            </el-form>
            <el-form
                    label-width="280px"
            >
                <div class="sub_title">特殊情况</div>
                <div class="flex-box-align">
                    <el-form-item
                            label="便秘患者："
                            prop="birthDate"
                    >
                        {{params.isAstriction}}
                    </el-form-item>
                    <el-form-item
                            label="糖尿病患者："
                            prop="birthDate"
                    >
                        {{params.isDiabetes}}
                    </el-form-item>
                    <el-form-item
                            label="神经疾病（中风、脊柱损伤、痴呆、截瘫或帕金森病、抑郁症）："
                            prop="birthDate"
                    >
                        {{params.isPsychosis}}
                    </el-form-item>
                </div>
                <div class="flex-box-align">
                    <el-form-item
                            label="既往肠道准备不合格患者："
                            prop="birthDate"
                    >
                        {{params.isGastroenterology}}
                    </el-form-item>
                    <el-form-item
                            label="肾功能衰竭："
                            prop="birthDate"
                    >
                        {{params.isRenalFailure}}
                    </el-form-item>
                    <el-form-item
                            label="心脑血管："
                            prop="birthDate"
                    >
                        {{params.isCardiovascularFailure}}
                    </el-form-item>
                </div>
                <div class="flex-box-align">
                    <el-form-item
                            label="肠道肿瘤："
                            prop="birthDate"
                    >
                        {{params.isIntestinalTumor}}
                    </el-form-item>
                    <el-form-item
                            label="腹部与盆腔手术史："
                            prop="birthDate"
                    >
                        {{params.isBellyFailure}}
                    </el-form-item>
                    <el-form-item
                            label="肠道狭窄或憩室："
                            prop="birthDate"
                    >
                        {{params.isIntestinalFailure}}
                    </el-form-item>
                </div>
                <div class="flex-box-align">
                    <el-form-item
                            label="肝硬化："
                            prop="birthDate"
                    >
                        {{params.isCirrhosis}}
                    </el-form-item>
                    <el-form-item
                            label="麻醉ASA分级（>=3级是危险因素）："
                            prop="birthDate"
                    >
                        {{params.isAnesthesia}}
                    </el-form-item>
                </div>
                <div class="flex-box-align">
                    <el-form-item
                            label="家族结直肠癌病史"
                            prop="birthDate"
                    >
                        {{params.isRectumHistory}}
                    </el-form-item>
                    <el-form-item
                            label="甲状腺疾病："
                            prop="birthDate"
                    >
                        {{params.isThyroidFailure}}
                    </el-form-item>
                    <el-form-item
                            label="住院治疗："
                            prop="birthDate"
                    >
                        {{params.inHospital}}
                    </el-form-item>
                </div>
            </el-form>
            <div class="sub_title">检查信息</div>
            <el-form
                    ref="information"
                    label-width="150px"
                    class=""
            >
                <div class="flex-box-align">
                    <el-form-item
                            label="预约医院："
                            prop="name"
                    >
                        {{params.hospital}}
                    </el-form-item>
                    <el-form-item
                            label="预约日期："
                            prop="sex"
                    >
                        {{params.makeDate}}
                    </el-form-item>
                    <el-form-item
                            label="预约时间："
                            prop="title"
                    >
                        {{params.makeTime}}
                    </el-form-item>
                </div>

                <div class="flex-box-align">
                    <el-form-item
                            label="检查方式："
                            prop="height"
                    >
                        {{params.reviewMode}}
                    </el-form-item>
                    <el-form-item
                            label="服用泻药："
                            prop="weight"
                    >
                        {{params.weight}}
                    </el-form-item>
                    <el-form-item
                            label="用药原因："
                            prop="birthDate"
                    >
                        {{params.medicalReasons}}
                    </el-form-item>
                </div>
                <div class="flex-box-align">
                    <el-form-item
                            label="原患疾病："
                            prop="height"
                    >
                        {{params.etiology || '无'}}
                    </el-form-item>
                    <el-form-item
                            label="合并用药："
                            prop="weight"
                    >
                        {{params.drugCombination || '无'}}
                    </el-form-item>
                </div>
                <el-form-item
                        label="补充信息："
                        prop="weight"
                >
                    {{params.remark}}
                </el-form-item>
            </el-form>
            <div style="margin-left: 180px;margin-top: 20px;">
                <el-button
                        type="primary"
                        @click="$router.back()"
                >返回</el-button>
            </div>
        </div>
    </div>
</template>

<script>
    let CONSTANT = require("../../constant/constant.js");
    let common = require("../../common.js");
    import $ from "jquery";
    export default {
        data() {
            return {
                params: {
                    "birthDate": "请选择",
                    "diplomas": "请选择",
                    "drugCombination": "",
                    "etiology": "",
                    "height": null,
                    "hospital": "",
                    "inHospital": "y",
                    "isAmentia": "y",
                    "isAnesthesia": "y",
                    "isAstriction": "y",
                    "isBellyFailure": "y",
                    "isCardiovascularFailure": "y",
                    "isCirrhosis": "y",
                    "isDiabetes": "y",
                    "isGastroenterology": "y",
                    "isIntestinalFailure": "y",
                    "isIntestinalTumor": "y",
                    "isLaxative": "y",
                    "isPsychosis": "y",
                    "isRectumHistory": "y",
                    "isRenalFailure": "y",
                    "isThyroidFailure": "y",
                    "makeDate": "",
                    "makeTime": "",
                    "medicalReasons": "",
                    "name": "",
                    "nation": "请选择",
                    "nickName": "",
                    "phone": "",
                    "remark": "",
                    "reviewMode": "",
                    "sex": "请选择",
                    "weight": null
                },
                id: ''
            };
        },
        components: {
        },
        mounted() {
            this.id = this.$route.query.id;
            if (this.id) {
                this.getDetail();
            }

        },
        methods: {
            handleClick(e) {
                this.$router.push(`/${e.name}`);
            },
            getDetail: function() {
                let url = CONSTANT.URL.reportDetail;
                common.post1(url, {id:this.id}, res => {
                    if (res.code == 200) {
                        let data = res.data.bussData;
                        this.params = data;
                        for (var i in this.params) {
                            if (this.params[i] === 'y') {
                                this.params[i] = '是'
                            } else if (this.params[i] === 'n') {
                                this.params[i] = '不是'
                            }
                        }
                    }
                });
            },
        }
    };
</script>
<style lang="scss">

</style>
